﻿@inject IConfirmService _confirmService

<div>
    <Tag Closable OnClosing="async e=>await onClosing(e)" OnClose="onClose">onClosing</Tag>
    <Tag Closable OnClosing="async e=>await onClosing(e)" OnClose="onClose">onClosing</Tag>
</div>

@code{
    void onClick()
    {
        Console.WriteLine("onClick");
    }

    async Task onClosing(CloseEventArgs<MouseEventArgs> e)
    {
        Console.WriteLine("onClosing");
        var result = await _confirmService.Show("Do you confirm to close this tag?", "Confirm");
        e.Cancel = result == ConfirmResult.Cancel;
    }


    void onClose()
    {
        Console.WriteLine("onClose");
    }

}